// https://api-hmugo-web.itheima.net  需要添加到合法域名

function request(params) {
    const baseUrl='https://api-hmugo-web.itheima.net/api/public/v1/'
    return new Promise((resolve, reject) => {
        wx.request({
            ...params,
            url:baseUrl+params.url,
            data:params.data,
            success: (result) => {
                resolve(result.data.message)
            },
            fail: (reject) => {
                reject(err)
            },

        });


    });
}

export default request